package org.net.loader
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import org.net.loader.ResourceData;
	/**
	 * Abstract Loader
	 */
	public class ALoader extends EventDispatcher
	{	
		protected var _resData : ResourceData;
		
		protected var _isLoading : Boolean = false;

		protected var _isLoaded : Boolean = false;
		//数据读取进度
		protected var _loadProgress : LoadProgress;
		
		
		
		public function ALoader(data : ResourceData)
		{
			_resData = data;
			_loadProgress = new LoadProgress();
		}
		
		
		public function get loadProgress():LoadProgress
		{
			return _loadProgress;
		}

		/**
		 * 获得URL地址
		 * 
		 * @return URL地址
		 */
		public function get url() : String {
			return _resData.url;
		}
		
		
		public function get isLoaded() : Boolean {
			return _isLoaded;
		}
		
		
		/**
		 * 获得键
		 * 
		 * @return 键
		 */
		public function get key() : String {
			return _resData.key;
		}
		
		
		/**
		 * 开始加载
		 */
		public function load() : void {
			throw new Error("Must use a loader subclass with this method defined.");
		}
	}
}